const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
    app.use(
        '/api',
        createProxyMiddleware({
            target: 'http://192.168.2.119:8080/lyh-admin', // 代理服务器的地址
            changeOrigin: true,
            pathRewrite: {
                '^/api': '', // 重写请求路径，去掉 '/apis' 前缀
            }
        })
    );
};